Proxy processing method

ABSTRACT

A proxy processing method to flexibly add/modify customized operations such as customized user authentication and accounting is provided. A state transition engine stores state information and moves processing forward by updating states. It has the following characteristics. (1) a state transition table indicating proxy processing procedure is generated from a state definition file at start-up (1-(1)). (2) A state transition engine implements proxy processing according to the state transition table (1-(2)). (3) A feature is provided to add an extended region for extended features to the session management table (1-(3)). Also, with regard to extended logging: (1) An extended log definition file indicates extended log information to be logged (2-(1)). (2) Extended log information based on the extended log definition is stored in the session management table (2-(2)). (3) Each access log provides two types of separate information, a fixed-length standard log and a variable-length extended log.

BACKGROUND OF THE INVENTION

[0001] The present invention relates to a proxy processing method. More specifically, the present invention relates to a proxy processing method that allows flexible feature expansion and logging. The proxy processing referred to here relates to various processing operations such as the relaying of requests, e.g., Web access request, from a client terminal to a server, as well as operations for authentication, access logging, caching, accounting, and value-added services.

[0002] An overview of conventional proxy processing will be described.

[0003]FIG. 19 is a drawing for the purpose of describing conventional proxy processing.

[0004] A proxy device 20 receives requests from a client terminal 10. The request contains a request header and content data. The request header can contain, for example, a URL, browser information, specific user information, and the like. The content data can contain, for example, Web POST data, e.g., a user name and address. The proxy device 20 sends the received request to a Web server 40. The Web server 40 responds to the request by sending a reply. The reply contains a reply header and content data. The reply header contains termination information (abnormal, normal), server information, context type, context length, specific reply information, and the like. The proxy device 20 keeps performed fixed accounting operations and keeps an access log of fixed information.

[0005] With the conventional technology, however, only fixed proxy operations could be performed, making it difficult to provide extended features. Also, the access log information in the conventional technology is fixed (with a fixed header field), making it impossible to select specific extended information and header fields for logging.

SUMMARY OF THE INVENTION

[0006] The present invention overcomes the problems described above and provides a proxy processing method that allows flexible adding and modification of specific extended operations. The present invention also provides flexible logging by allowing selection of specific extended information, header fields, and the like.

[0007] According to one aspect of the present invention, the proxy processing method includes:

[0008] a step for reading a state definition file storing state name in a transition sequence, the states representing processing steps for the request operation;

[0009] a state selection step selecting from a standard module and extension modules a state information entry matching with the state name in the state definition file, the standard module storing session processing functions associated with standard states for standard features, and the extension modules storing session processing functions associated with extended states for extended features;

[0010] a state transition table generating step generating, at startup, a state transition table based on a selected state information entry, the state transition table storing a session processing function associated with each state and a next transition state of the processing; and

[0011] a step for executing a session processing function defined for each state according to the generated state transition table.

[0012] According to another aspect of the present invention, the proxy processing method includes:

[0013] a step for sequentially reading state names from a state definition file containing state names in a transition sequence, the each state represents a processing step in processing a request from a client terminal;

[0014] a step for retrieving from a module table a state information entry having a state name that was read, the module table containing a list of state information, and each state information storing a state name and an associated state identifier, a session processing function, a configuration function allocating a work region and the like, a session initialization function called when a session is initiated, and a session termination function called when a session is terminated.

[0015] According to another aspect of the present invention, in the proxy processing method using a single processing process to simultaneously process requests from a plurality of clients, operations from a receipt of a request to a termination of the processes of the request are handled as a single session, a processing status is stored for each session in a session management table, and a session scheduler is used to schedule client sessions that have become ready to process.

[0016] The session scheduler includes: a step for checking for events indicating ready status for receiving request and response data and the like; a step for selecting one session management table entry out of entries for ready sessions if a ready status event is generated or is received; and a step for executing a state transition engine using as parameters the selected session management table entry and event information. The state transition engine includes a step for looking up a state transition table indicating a transition sequence of states wherein each state represents a processing step for processing a request from a client terminal and sequentially executing processing functions in the state transition table entry associated with current state information stored in the session management table.

[0017] According to another aspect of the present invention, the proxy processing method includes processes of storing state status representing processing steps in processing requests from client terminals, updating states, and using a state transition engine to sequentially execute processing functions associated with state. The proxy processing method also includes:

[0018] a step for executing the state transition engine,

[0019] the state transition engine including a step for looking up, for each session from a client terminal, a session management table storing information including state information, standard information, and extended information specific to extension modules;

[0020] the state transition engine including a step for using state information in the session management table to obtain a state transition table entry storing session processing functions and default next states associated with a processing state;

[0021] the state transition engine including a step to execute a session processing function from the obtained state transition table entry;

[0022] the state transition engine including a step to determine a next transition state using a value returned from the executed session processing function, and setting up the next state information in the session management table entry; and

[0023] a step for executing processing for the next state if the returned value is that for transition to a next state, and returning to a scheduler and requesting the scheduler to schedule another ready session if the returned value is that for session rescheduling.

[0024] According to another aspect of the present invention, in the proxy processing method, access logging for logging processes of a request from a client is performed with logging data formed from a fixed-length standard log region and a variable-length extended log region. The proxy processing method also includes:

[0025] a step for loading definition information at start-up from an extended logging definition file containing log types to be logged;

[0026] a step for storing extended logging information based on the definition information in a session management table managing a processing status for a request from a client terminal; and

[0027] a step for executing logging including extended information based on the definition information.

[0028] These and other benefits are described throughout the present specification. A further understanding of the nature and advantages of the invention may be realized by reference to the remaining portions of the specification and the attached drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

[0029]FIG. 1 is a drawing for the purpose of describing a flow of operations performed in a standard Web caching proxy.

[0030]FIG. 2 is a drawing for the purpose of describing the structure of a module table.

[0031]FIG. 3 is a drawing for the purpose of describing the main information stored in a module table.

[0032]FIG. 4 is a drawing for the purpose of describing sample items defined in a state definition file.

[0033]FIG. 5 is a drawing for the purpose of describing the main information stored in a session structure (session management table entry).

[0034]FIG. 6 is a drawing for the purpose of describing the main information stored in each state transition table entry.

[0035]FIG. 7 is a flowchart showing the overall flow of operations performed in proxy processing.

[0036]FIG. 8 is a drawing for the purpose of describing the building of a state transition table at start-up.

[0037]FIG. 9 is a flowchart showing a flow of operations performed in building a state transition table.

[0038]FIG. 10 is a drawing for the purpose of describing a flow of operations performed by the session scheduler.

[0039]FIG. 11 is a drawing for the purpose of describing HTTP session processing by a proxy device.

[0040]FIG. 12 is a flowchart showing the operations performed by a state transition engine.

[0041]FIG. 13 is a drawing for the purpose of describing a return value from a session processing function for each state and the operations thereof.

[0042]FIG. 14 is a drawing for the purpose of describing proxy operations.

[0043]FIG. 15 is a drawing for the purpose of describing an extended log definition file.

[0044]FIG. 16 is a drawing for the purpose of describing how access logs are recorded.

[0045]FIG. 17 is a drawing for the purpose of describing a flow of operations performed for outputting an access log at the end of each session.

[0046]FIG. 18 is a drawing for the purpose of describing operations associated with log types.

[0047]FIG. 19 is a drawing for the purpose of describing conventional proxy processing.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0048] 1. HTTP session operations performed by the proxy device

[0049] HTTP session operations (processing of client requests) performed in this embodiment will be described.

[0050]FIG. 1 is a drawing for the purpose of describing a flow of operations performed in standard Web caching proxy processing.

[0051] This system includes Web clients 1, a Web caching proxy 2, a cache 3, and a Web server 4. In response to Web access requests from the Web clients, the Web caching proxy will generally perform the following operations. In the figure, the circled numbers correspond to the steps numbered in parentheses below.

[0052] (1) When a Web client 1 makes a request, a request connection is set up between the Web client 1 and the Web caching proxy 2 and an HTTP session is initiated with the client terminal.

[0053] (2) The web caching proxy 2 receives the request.

[0054] (3) The web caching proxy 2 analyzes the request.

[0055] (4) The web caching proxy 2 checks to see if information is available in the cache 3.

[0056] a. If information is not available in the cache, the following operations are performed.

[0057] (5) A connection from the web caching proxy 2 to the Web server 4 is established.

[0058] (6) A request is sent from the web caching proxy 2 to the Web server 4.

[0059] (7) A response from the Web server 4 is received by the web caching proxy 2.

[0060] (8) The web caching proxy 2 checks the received resoponse from the Web server 4.

[0061] (9) The web caching proxy 2 stores content data in the cache 3.

[0062] (10) The web caching proxy 2 sends the content data to the Web client 1.

[0063] (11) The HTTP session is closed.

[0064] b. If information is available in the cache, the following operations are performed.

[0065] (15) The web caching proxy 2 reads the content data from the cache 3.

[0066] (16) The content data obtained from the cache 3 is sent back to the Web client 1 via the web caching proxy 2.

[0067] (17) The HTTP session is closed.

[0068] In this proxy processing method, a process or thread is assigned to each request from a Web client, and procedures corresponding to steps (1)-(17) (the circled numbers 1-17 in the figure) are called sequentially. This method results in a heavy resource load since a process or thread has to be assigned to each request. This leads to a high overhead involving the operating system's process or thread switching, making the method unsuitable for handling large numbers of requests.

[0069] In the proxy processing method of this embodiment, a single process handles requests from multiple Web clients. The status for each request (HTTP session) from a Web client, i.e., at which step among (1)-(17) the request is processed now, is stored as a state, and requests are processed by updating these states. The proxy processing includes various types of operations such as customized authentication, relaying of requests, caching, customized access logging, accounting, value-added services, and the like.

[0070] 2. Module management

[0071] First, tables associated with proxy processing will be described.

[0072] 2-1. The Module table

[0073] The program executed by the proxy processing device contains a group of modules, which are functional groupings. A module serves as a single unit for adding and removing of features, and contains state processing functions, I/O processing functions, module-specific data in shared memory, and the like. The proxy processing device uses a module table to manage the modules. Each of the module table entry contains a list of state information that the module provides. With this state information, the proxy processing device can build a state transition table at start-up, and features provided by modules can be easily added and removed.

[0074]FIG. 2 is a drawing for the purpose of describing the structure of the module table. FIG. 3 is a drawing for the purpose of describing the main information stored in the module table.

[0075] The module table is a table used to define what kind of modules (features) are grouped together in the program. Each entry of the module table associates with a module object, and contains a name of the module object and a list of state information provided by the module object(see figure for contents of each field). The list of state information is referenced in building the state transition table, and state information selected from the list is used as a base for an entry of the state transition table. Each state information contains a name of the state and a session processing function associated with the state in order to implement the features provided by a module the state belongs to such as a standard module and an accounting module. The state transition table is created by selectively combining necessary state information from appropriate modules.

[0076] The modules can be static link ones which are registered in advance in the module table, and objects of the modules are statically linked with other objects. Alternatively, dynamic loading of modules can be supported, with modules being registered dynamically in the module table. Even with the static link modules, however, not all features of loaded modules are activated. Only required module features provided by states described in the state transition table are selectively activated by the generation of the state transition table at start-up time.

[0077] In addition to a state name and a session processing function for the state, the state information includes a state identifier (state ID), a state configuration function for allocating regions required by the state or module at start-up, a session initialization function allocating regions needed by the state or module and performing initialization operations and the like when a request is received from a client, a session completion function releasing unneeded regions and performing various termination operations when processes of the request is completed, and the like.

[0078] 2-2. The state configuration file

[0079] The state configuration file is a file describing state configuration information used to build the state transition table.

[0080]FIG. 4 is a drawing for the purpose of describing a sample state configuration file.

[0081] The state configuration file contains state names used in the state transition table arranged according to the default state transition sequence. “#” is a special character that indicates that the rest of the line is a comment. Blank lines can also be included. In this example, state names are defined in order: (1) Accept_Clt, (2) Get_Rep_Hdr, (3) Parse_Rep_Hdr, (4) Check_Auth, and (5) Check_Cache.

[0082] 2-3. Session management table

[0083]FIG. 5 is a drawing for the purpose of describing the main information stored in a session structure (session management table entry).

[0084] An overview of the session management table will be presented below.

[0085] In the proxy processing method of the present invention, client requests are handled as HTTP sessions, each session starting with a receipt of a request (establishing a communication channel) and ending with the completion of processes of the request. Each entry of the session management table is used to store information associated with an HTTP session starting with a receipt of a request from a Web client and ending with the completion of processes of the request. The session management table manages the processing status for each request from a client. A session table entry is generated and managed for each HTTP session. In addition to the current (active) state information of an HTTP session, the session table entry stores various standard and extended information needed to process the request from a Web client. The session management table entry associated with an HTTP session will be referred to below as a session structure. In this example, each entry of the session management table includes fields for a session ID, state information, communication route information, a send/receive buffer, request information, reply information, processing results information, module-specific extension information, and the like (see the figure for descriptions of field contents).

[0086] Next, region extensions for extension modules will be described.

[0087] In addition to a region to hold the standard information used by a default HTTP module, this session management table can hold regions specific to extension modules in the session structures. The resions specific to extension modules hold module-specific extension information. If necessary, a module can call a particular function, e.g., via a state configuration function described later, to allocate a module-specific region (module-specific extension information) in a session structure.

[0088] 2-4. The state transition table

[0089]FIG. 6 shows a drawing for describing the main information stored in state transition table entries.

[0090] Each state transition table entry stores a session processing function for a state corresponding to each processing step (1)-(17) of a proxy operation as described above, and also stores information for a default next state. This state transition table is generated using the state definition file when the proxy operation is started up, as described later. In this example, each state transition entry includes: a state ID, a state name, a session processing function for the state, a state configuration function, a session initialization function, a session termination function, and a default next state information (see figure for description of fields).

[0091] 3. Overview of proxy processing

[0092]FIG. 7 is a flowchart showing the overall flow of operations performed in proxy processing.

[0093] When a proxy processing is started, the proxy processing device initializes memory, I/O devices, interfaces, and the like (S01). Next, a state transition table is built (S03). For details of this, see primarily FIG. 9 and the descriptions therein. Next, the proxy processing device executes the state configuration function for each of the states (S05). The execution of the state configuration function for each state is performed only once at start-up. The proxy processing device allocates enough space for the session management table needed for each session. Next, the proxy processing device launches processes for processing HTTP sessions. (S07).

[0094] The steps will be described in detail below.

[0095] 3-1. Building of the state transition table at start-up

[0096] Using the state definition file, the proxy processing device selects session processing features of necessary states from the module table to dynamically build a state transition table when proxy processing is started.

[0097]FIG. 8 shows a drawing for the purpose of describing how the state transition table is built at start-up.

[0098] The state transition table is built by sequentially searching the lists of state information in the module table for state transition table entries having state names described in the state definition file, and copying the matching entries.

[0099]FIG. 9 is a flowchart showing a flow of operations used to build the state transition table. The searching of state names is performed according to a predetermined sequence, e.g., starting with a last registered module. Thus, in this case, if multiple modules provide states having the same state name, the entry for the most recently registered module is selected with higher priority. A description, based on a flowchart, of a flow of operations is as follows.

[0100] Step S801 (open state definition file):

[0101] Open the state definition file to read state definition information.

[0102] Step S802 (read state name)

[0103] Read a state name one at a time in sequence from the state definition file.

[0104] Step S803 (check for completion):

[0105] Jump to step S810 if there is no more state name to be processed.

[0106] Step S804 (search for entry in module table):

[0107] If there is a state name to be processed, search the lists of state information in the module table for a state transition table entry having the indicated state name.

[0108] Step S805 (copy entry to state transition table)

[0109] Copy and register the state information found at step S804 to a new entry of the state transition table.

[0110] Step S806 (set up default next-state information):

[0111] Based on the order in the state definition file, set up the default next-state information in the state transition table entry registered at step S805 to point to the state transition table entry to be registered next. If the current entry is the last in the state definition file, set up information (NULL) indicating that the entry is the last.

[0112] Step S807 (assign state ID and set up state_index):

[0113] If the state ID is 0, generate a unique state ID and assign the ID. Also set up a state index (state_index) to allow state transition table entries to be indexed by the state ID. If the state ID is not 0, check to see if the same ID has not already been registered. If so, display an error message.

[0114] Step S808 (register session initialization function list):

[0115] If the session initialization function is set up, register the function onto a session initialization function list. This list is used to call initialization functions when a session is initialized.

[0116] Step S809 (register session termination function list):

[0117] Similarly, if the termination functions are set up, register the function onto a termination function list. Return to step S802.

[0118] Step S810 (close session definition file)

[0119] Close the session definition file.

[0120] Step S811 (execute state configuration functions):

[0121] Execute the state configuration functions for each state transition table entry set up in step S801-step S810. If all state configuration functions are executed successfully, the building of the state transition table is finished.

[0122] 3-2. Operations of state configuration function

[0123] The standard information in the session management table is common to all modules and is looked up and updated by each module. The extension information in the session management table is specific to individual extension modules and is looked up and updated by these extension modules. The extension information region is allocated by executing a function to allocate the extended region in the session management table. The configuration function receives offset information indicating the location of the allocated extended region from the extended region allocation function, and this offset information is stored as an offset variable in the extension module. This offset variable is used to reference and update the extended region.

[0124] 3-3. The session processing process

[0125]FIG. 10 is a drawing for the purpose of describing a flow of operations performed by a session scheduler.

[0126] The session scheduler performs scheduling of client HTTP sessions that are ready to process. The operation flow will be described.

[0127] Step S401 (start execution of session processing process): create session processing processes and begin execution of the created processes.

[0128] Step S402 (wait for events such ready-events of network I/O and interprocess communication reply): The session scheduler checks for events, such as ready-events of network I/O and interprocess communication reply, and an arrival of a request to establish a connection from a Web client. If no event is detected, the scheduler waits until any of above events is raised or a fixed interval timeout comes.

[0129] Step S403 (check event kind): The kind of the event detected at step S402 is checked, and processing branches depending on the event kind. The operations that are performed can be, for example, as follows.

[0130] (1) If a request to establish a connection from a Web client arrives, jump to step S404.

[0131] (2) If a ready-event is raised, jump to step S406.

[0132] (3) If a timeout occurs, jump to step S408.

[0133] (4) If a termination event in response to an operator instruction arrives, jump to step 409.

[0134] Step S404 (establish connection): If a request to establish a connection arrives from a Web client, the session scheduler establishes a connection and control goes to step S405.

[0135] Step S405 (create and initialize session table entry): Next, the session scheduler creates a session table entry and initializes the session table entry. The session scheduler looks up the session initialization function list that was generated at step S808 when the state transition table was built. The session initialization functions for the states are called, module extended regions are initialized, and the like. Then, control goes to step S402, and the session scheduler waits for an HTTP request to arrive from the Web client.

[0136] Step S406 (select a ready HTTP session): If a ready-event is raised, the session scheduler selects a session table entry for a ready HTTP session to process. Control proceeds to step S407.

[0137] Step S407 (execute state transition engine): Next, the state transition engine is called passing the session table entry and event information as parameters (the operations of the state transition engine will be described in detail later). An example of an event information passed to the state transition engine is the information such as “input/output operation is ready on a communication channel associated with the selected session”. When control returns from the state transition engine, the session scheduler returns to step S402 and schedules another ready HTTP session.

[0138] Step S408 (timeout processing): Even if no event is detected at step S402, wait at step S402 ends periodically with a timeout, and timeouts for network I/O for each session is checked. If an HTTP session timeout is detected, the corresponding HTTP session is notified of a timeout event and control returns to step S402. As a result, steps S406 and S407 can schedule the HTTP session with a ready-event by the timeout.

[0139] Step S409 (termination processing of session processing processes): If an operator inputs a termination command, the session scheduler is informed a termination of a proxy processing, and performs a processing to terminate the session processing processes. Control then proceeds to step S410.

[0140] Step S410 (terminate session processing processes): After the processing at step S409 completes, the session scheduler terminates the session processing processes.

[0141] 3-4. State transition engine

[0142]FIG. 11 shows a drawing for the purpose of describing the HTTP session processing performed by the proxy device. FIG. 12 shows a flowchart of the operations performed by the state transition engine. The state transition engine processes each HTTP session by saving a current state information of the session processing to the corresponding session table entry, and updating the current state information while sequentially executing session processing functions described in the state transition table entries. The numerals in parentheses below correspond to the numerals in parentheses in FIG. 11.

[0143] (1) Step 301: Schedule ready HTTP session and start the state transition engine

[0144] First, the session scheduler for the session processing processes detects that an HTTP session has become ready to process via an event such as arrival of data. Then, the session scheduler executes the session transition engine passing a session structure for the HTTP session and the detailed event information as parameters. For details on the operations performed up to the execution of the state transition engine, see FIG. 10 (the session processing process) and associated descriptions.

[0145] (2) Step S302 (look up current state information and obtain state transition table entry): Next, the state transition engine looks up state information (state ID) for the session structure and obtains the associated state transition table entry. In this example, state (2) is looked up.

[0146] (3) Step S303 (execute session processing function for the state): Next, the state transition engine executes the session processing function for the state described in the state transition table entry obtained at step S302 (in this example, the session processing function named rcv_req_hdr is executed). When executing the session processing function for the state, the session structure and the event information are passed as parameters (this will be described in detail later).

[0147] (4) At step S304 (transition to next state): Next, the state transition engine determines a next transition state from the value returned by the session processing function for the state, and information about the next state is set up in the session structure.

[0148]FIG. 13 is a drawing for the purpose of describing the value returned from the state processing function and how it works. The return values can be values such as “ADV”, “GOTO”, “SCHED”, “ERROR”, and “END” (see figure for actions of the state transition engine, purpose, and the manner in which the session processing function for the state uses the return values). For example, if the return value is “ADV”, a state transition is made to a default next state described in the state transition table entry associated with the current state. If the return value is “GOTO”, a state transition is made to a state indicated in a state ID field in the session structure. If the return value is “SCHED”, a control is returned to the session scheduler, and an event for the session will be waited for without changing the current state. A processing for the session will be started again with the same state when the session has become ready to process. If the return value is “ERROR”, the state will change to a state for error information reply. If the return value is “END”, a processing for the HTTP session is terminated. In this case, the session termination functions described in the session termination function list are executed, the associated session table entry is released, and control returns to the session scheduler.

[0149] If the return value is not “END” and not “SCHED” (e.g., the return value is “ADV”, “GOTO”, or “ERROR”), control returns to step S302 and subsequent state processing is performed. If the return value is “END” or “SCHED”, control goes to step S305.

[0150] (5) Step S305 (return to session scheduler and request for rescheduling): If a rescheduling is necessary in a case such as waiting for the arrival of data to process from a network, “SCHED” is returned as the return value by the session processing function for the state. If a processing of the HTTP session is to be terminated, “END” is returned by the session processing function. In both cases, “SCHED” and “END, control returns to the session scheduler, and the session scheduler schedules another ready session.

[0151]FIG. 14 shows a simplified drawing for the purpose of describing proxy operations.

[0152] As described above, the state transition engine in this embodiment saves a current state information and updates it in the session management table entry. Characteristics of the state transition engine will be described.

[0153] (1) By a configuration function at startup, the state transition table to indicate a proxy processing procedure is built using a state definition file (see 1-(1) in the figure)

[0154] In this embodiment, the processing of requests from Web clients are divided into states, and a flexible proxy processing is can be provided by building the state transition table that indicates the processing procedures following the state definition file. With the insertion/addition/replacement of state names in the state definition file, customized processing can be realized for various needs such as customized accounting and authentication.

[0155] (2) The state transition engine is used to implement proxy processing according to the state transition table (see 1-(2) in the figure).

[0156] According to this embodiment, functions such as the ones listed below are registered and defined for each state. Proxy processing is implemented by having the state transition engine execute these functions according to the state transition table created at (1). The functions can carry out various customized operations, e.g. (a) session processing function for the state, (b) configuration function for various initialization at startup, (c) session initialization function called when a session is started, and (d) post-processing function (termination function) for when a session processing for the session is completed. By registering the functions for the extended states, various customized operations can be carried out.

[0157] (3) Additional feature to add extended regions used for extended functions in each session management table entry is provided (see 1-(3) in the figure)

[0158] This embodiment provides a feature for adding extended regions to the standard information region in each session management table entry that manages the processing state for an individual client request. A configuration function(b) for each state specified in each state transition table entry is executed at startup, and uses the extended region allocation feature to allocate extended regions if necessary. The allocated extended regions store specific information that is necessary for the processing by the extended states for each session. Each session management table entry can include, for example, current state information, user information, standard information, and extended information. The initialization and termination operations on these regions in each session management table entry can be performed by the session initialization function(c) and the session post-processing function(d).

[0159] 4. Extended logging

[0160] An embodiment for an extended logging, which is an extension to standard logging, will be described using FIG. 14.

[0161]FIG. 15 is a drawing for the purpose of describing an extended logging definition file.

[0162] (1) Indicate extended log information to log with an extended logging file (see 2-(1) in FIG. 14)

[0163] In this embodiment, an extended logging definition file contains log types, request or response header field names to be logged, log sizes, type numbers, display names, and the like. When the proxy processing device is started up, the definition information is loaded from the file as extended logging definition information. Access logging operations are performed according to this definition, thus providing flexible logging.

[0164] The log types is as shown in the figure. The log size indicates a size of the log if the logging size is fixed. The type number is a unique number to distinguish log contents. In particular, it is used for logging information for special extended operations (SPECIAL). The display name is a name displayed by log analysis/dump tools.

[0165] (2) Store extended logging information in the session management table following the extended logging definition (see 2-(2) in FIG. 14)

[0166] When parsing request and response headers, and the like, information defined by extended log types (such as REQ_FLD and REP_FLD) are stored as extended log definition information in each session management table entry. Information defined by standard log types (such as CLT_REQ_URL, REQ_FLD_USR, REQ_VER and REP_VER) are stored as standard log definition information in each session management table entry.

[0167] (3) Make each access log with two types of separate loggings, a fixed-length standard log and a variable-length extended log

[0168]FIG. 16 is a drawing for the purpose of describing how access logs are recoreded (see 2-(3) in the figure).

[0169] The processing for making an access log will be described.

[0170] Each access log is formed from a fixed-length standard log that logs standard and common log information and a variable-length extended log that logs according to the extended logging definitions described above. The fixed-length standard log is output based on standard information in each session management table entry, while the variable-length/extended log is output using the extended information as well as the standard information in each session management table entry. This provides extendable access logging.

[0171] The length of each access log is a multiple of a fixed block size and is indicated at a start field of the fixed-length standard log. This allows high-speed log processing of the variable-length log. The fixed-length standard log information can include request and response sizes, response status, user information (corresponds to #5), and the like.

[0172] In addition to having total length information of the variable-length extended log region, the variable-length extended log region includes offset information (an array of offsets) that indicates where each extended log defined by defined by the extended logging definition is output, and the actual extended logging data (extended log information) for each extended log. By providing the array of offsets, a position of each extended log in the variable-length log can be obtained with a single indirect access operation. Thus, statistical operations can be performed on specific extended log fields in the log, e.g., tabulating fields, at high speeds. The size of each extended log data can be determined from offsets for previous and subsequent extended logs, and string-type data can be processed without knowing size information(excluding issues of maximum buffer size) because the string-type data is always terminated with NULL byte.

[0173] An extended log for a “SPECIAL” type is output by a hook function called from the standard access log processing function. If the “SPECIAL” type extended log is required, the hook function is set up by a state configuration function for an extended state. A hook function variable indicates a hook function to call. If a non-zero call address is set in the hook function variable, the hook function indicated by the hook function variable is called when making each access log, thus providing loggings specific to extended states.. This allows extended loggings specific to customized features.

[0174] A log header is output at the start of each access logging file. This log header contains endian information, statistical summary information, a copy of the extended logging definition information, and the like. The endian information allows logs to be analyzed even if the machine uses a different byte-endian system. The statistical summary information allows simple summary operations without analysis/tabulation of the entire access log stored in the access log file. A copy of the extended log definition information can provide information on what types of logs are stored, how to access the logs, and how to display the logs in the variable-length extended region.

[0175] Thus, a log analysis tool can output various types of analysis results based on the generated access log . I

[0176]FIG. 17 shows a drawing for the purpose of describing a flow of operations performed when outputting an access log at the end of each session.

[0177] S201: When a session is terminated and an access log output operation is called. The access log output operation looks up the standard information in the session management table entry associated with the session, and outputs a pre-determined fixed-length standard log. The fixed-length standard log is a log information that is fixed and always output in this proxy.

[0178] S203: Following the instructions in the extended log definition file, offset information indicating the output position for each extended log and data of each extended log are output in sequence as the extended log.

[0179]FIG. 18 is a drawing for the purpose of describing various operations associated with the log types indicated in the extended log definition file at step S203.

[0180] In the description above, the execution of the session initialization functions is performed by the session scheduler, and the session termination functions are executed by the state transition engine called by the session scheduler. The present invention is not restricted to this, however, and it would also be possible to execute session initialization functions by the state transition engine, and/or session termination functions can be executed by the session scheduler.

[0181] The proxy processing method and proxy device of the present invention can also be provided via a proxy processing program, a computer-readable storage medium containing a proxy processing program, a program product containing a proxy processing program capable of being loaded into the internal memory of a computer, a computer, such as a server, that contains the program, and the like.

[0182] As described above, the present invention provides a proxy processing method that allows customized operations, such as customized user authentication and accounting, to be added and modified in a flexible manner. The present invention also allows a flexible access logging by selecting logging items for information specific to customized features and special header fields to be logged ,and allows high-speed analysis and tabulation operations on the access log.

[0183] The specification and drawings are, accordingly, to be regarded in an illustrative rather than a restrictive sense. It will, however, be evident that various modifications and changes may be made thereto without departing from the broader spirit and scope of the invention as set forth in the claims. 

We claim
 1. In an operation for processing a request from a client terminal, a proxy processing method comprising: a step for reading a state definition file storing state names in a transition sequence, said states representing processing steps for said request operation; a state selection step selecting a state information defined in a standard module and extension modules matching with a state name specified in said state definition file, said standard module storing processing functions associated with standard states for standard features, and said extension modules storing processing functions associated with extended states for extended features; a state transition table generating step generating, at startup, a state transition table based on selected state information, said state transition table storing a processing function associated with each state and a next transition state of said state; and a step for executing a processing function defined for each state according to said generated state transition table.
 2. A proxy processing method as described in claim 1 further comprising: a step for allocating a standard region in a session management table used to manage processing states for a request from a client terminal, said standard region being necessary for executing processing for standard states; and a step for allocating an extended region by executing an environment set-up function for an extended state, said extended region being necessary for processing for said extended state.
 3. A proxy processing method as described in claim 2 further comprising a step for executing logging operations associated with client requests and/or server responses, said logging operations being based on extended logging information stored in an extended region in said session management table.
 4. A proxy processing method as described in claim 1 wherein: a module table stores for each module object a module name of the module object and a list of state information provided by the module object, said list of state information including for each state a state name and a state identifier of the state, a session processing function for the state, a function for initializing and allocating a work region, and a termination processing function; and said state selection step selecting from said list of state information in said module table a state information entry associated with a state name specified in said state definition file.
 5. A proxy processing method as described in claim 1 wherein said state transition table associates a state identifier with a state name, a session processing function for the state, a configuration function performing allocation of a work region and the like, a session initialization function called when a session is initiated, a session termination function called when a session is terminated, and a next state.
 6. A proxy processing method comprising: a step for sequentially reading state names from a state definition file containing states names in a transition sequence, said each state representing a processing step in a processing sequence of a request from a client terminal; a step for retrieving from a module table a state information entry having a state name that was read, each entry of said module table containing a list of state information, and said state information containing a state name and an associated state identifier of the state, a session processing function for the state, a configuration function allocating a work region and the like, a session initialization function called when a session is initiated, and a session termination function called when a session is terminated.
 7. A proxy processing method as described in claim 6 further comprising a step for setting up a state identifier by generating a unique identifier for a retrieved state information entry if a state identifier has not been defined and detecting overlapped assignments by checking to see if an entry associated with said identifier is already set up in said state transition table.
 8. A proxy processing method as described in claim 6 further comprising a step for registering a session initialization function and a session termination processing function onto a session initialization function list and a session termination function list respectively if the non-null session initialization function and the session termination function are defined in said state transition table.
 9. In a proxy processing method using a single processing process to simultaneously process requests from a plurality of clients, a proxy processing method wherein: operations from a receipt of a request to a termination of the processes of the request are handled as a single session, a process status is stored for each session in a session management table, and a session scheduler is used to schedule client sessions that have become ready to process; said session scheduler including: a step for checking for events indicating ready status for receiving request and response data and the like; a step for selecting one session management table entry out of entries for ready sessions if a ready status event is generated or is received; a step for executing a state transition engine using as parameters said selected session management table entry and event information; and said state transition engine includes a step for looking up a state transition table indicating a transition sequence of states representing processing steps for processing a request from a client terminal, and sequentially executing session processing functions in said state transition table entries associated with current state information stored in said session management table.
 10. A proxy processing method as described in claim 9 wherein said session scheduler further includes a step for periodically performing a timeout check on each session.
 11. A proxy processing method as described in claim 9 further comprising: a step for executing a session initialization function when a connection is established, said session initialization function being obtained when said state transition table is built; and a step for executing a session termination function when a session is terminated.
 12. A proxy processing method as described in claim 9 further comprising a step for storing in said session management table, for each session from a client terminal, state information and various types of standard information as well as information containing extension information specific to extension modules, and, based on configuration functions associated with extended states of said extension modules, regions for module-specific extension information are allocated at start-up.
 13. A proxy processing method as described in claim 12 further comprising a step for executing a logging operation for client requests and/or server responses based on standard information and extended information in said session management table.
 14. A proxy processing method as described in claim 9 wherein said state transition engine includes: a step for looking up a session management table storing, for each session from a client terminal, information-including state information, standard information, and module-specific extension information; a step for using said state information in said session management table to look up a state transition table to obtain a state transition table entry, said state transition table storing a session processing function associated with each state and a next transition state of said state; a step for executing a session processing function of said obtained state transition table entry; and a step for determining a next transition state using a value returned from an executed session processing function and setting up said next state information in said session management table entry.
 15. In a proxy processing method storing state status representing processing steps in processing requests from client terminals, updating states, and using a state transition engine to sequentially execute processing functions associated with state, a proxy processing method comprising: a step for executing said state transition engine, said state transition engine including a step for looking up, for each session from a client terminal, a session management table storing information including state information, standard information, and extended information specific to extension modules; said state transition engine including a step for using state information in said session management table to obtain a state transition table entry by looking up a state transition table storing session processing functions and default next states associated with each state; said state transition engine including a step to execute a session processing function from said obtained state transition table entry; said state transition engine including a step to determine a next transition state using a value returned from an executed session processing function, and setting up said next state information in said session management table entry; and a step for executing session processing for said next state if said returned value is that for transition to a next state, and returning to a scheduler and requesting said scheduler to schedule another ready session if said returned value is that for session rescheduling.
 16. A proxy processing method as described in claim 15 comprising any one or more of the following steps: a step for updating to a next default state if a value returned from a session processing function is that for state transition to a default next state; a step for updating to a state indicated in a predetermined field if a value returned from a session processing function is that for goto-type state transition to a state explicitly specified; a step for updating to an error information reply state if a value returned from a session processing function is that for state transition to an error reply state; and a step for executing a session termination function, releasing said session management table entry, terminating said current session, and returning to said session scheduler if a value returned from a session processing function is that for terminating the session processing.
 17. A proxy processing method including: a step for loading definition information at start-up from an extended logging definition file containing log types to be logged; a step for storing extended logging information based on said definition information in a session management table managing a processing status for a request from a client terminal; a step for executing logging including extended information based on said definition information.
 18. In a proxy processing method as described in claim 17 wherein access logging for logging processes of a request from a client is performed with logging data formed from a fixed-length standard log region and a variable-length extended log region, a proxy processing method comprising: a step for storing a log record length and fixed-length standard log information of logging data in a fixed-length standard log; a step for storing in said variable-length/extended log region offset information indicating output position and extended logging data based on a variable-length region size and definition information in an extended logging definition file; wherein said generated access log is looked up to perform logging analysis and tabulation operations.
 19. A proxy processing method as described in claim 18 further comprising: a step for performing analysis and tabulation of said access log by analyzing and tabulating fixed-length standard information through referring to said fixed-length standard log region in said access log; and a step for performing analysis and tabulation of said access log by referring to said variable-length extended log region of said access log, retrieving offset information for desired variable-length extended log information, and analyzing/tabulating variable-length extended log data by accessing variable-length/extended logging data using said retrieved offset information.
 20. A proxy processing method as described in claim 18 further comprising a step for storing any one or more of endian information, statistical summary information, and a copy of said extended log definition information. 